package edu.yzu.testspringboot002.controller;

import edu.yzu.testspringboot002.po.Doctor;

import edu.yzu.testspringboot002.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/doctors")
public class DoctorController {
    @Autowired
    private DoctorService doctorService;

    @PostMapping
    public void addDoctor(@RequestBody Doctor doctor) {
        doctorService.addDoctor(doctor);
    }

    @GetMapping("/{id}")
    public Doctor getDoctorById(@PathVariable int id) {
        return doctorService.getDoctorById(id);
    }

    @GetMapping
    public List<Doctor> getAllDoctors() {
        return null;
    }

    @PutMapping
    public void updateDoctor(@RequestBody Doctor doctor) {
        doctorService.updateDoctor(doctor);
    }

//    @DeleteMapping("/{id}")
//    public void deleteDoctor(@PathVariable int id) {
//        doctorService.deleteDoctor(id);
//    }
}